/*
 *  ME218_Sprites.h
 *
 *  Created by Rick Miley on 3/17/11.
 *  Copyright 2011 Smileyoil. All rights reserved.
 *
 */


#ifndef ME218_SPRITE_HEADER_FILE		// make sure CLUT header file is included only once
#define ME218_SPRITE_HEADER_FILE

#include <avr/pgmspace.h>

//#ifdef PROGMEM 
//#undef PROGMEM
//#define PROGMEM __attribute__((section(".progmem.data")))
//#define PROGMEM __attribute__((__progmem__))
#define PROGMEM_XXX __attribute__((section(".progmem.miley")))
#define	prog_uchar_XXX unsigned char
#define	prog_uint16_t_XXX int  


//#endif




#define		Clockwise	1
#define		CounterClockwise	0
#define		TIP_TOP_TOTAL	5




#define	Wall	0x01
#define Clear	0x00

#define FA_C1	0x06		// FighterA Color 1
//#define	FA_C2	0x04		// FighterA Color 2
#define	FA_C2	0x07		// FighterA Color 2


#define FB_C1	0x05		// FighterB Color 1
#define	FB_C2	0x03		// FighterB Color 2

#define FC_C1	0x01		// FighterC Color 1
#define	FC_C2	0x02		// FighterC Color 2

#define FD_C1	15 		// FighterD Color 1
#define FD_C2	0x0c		// FighterD Color 2

#define FE_C1	0x01		// FighterE Color 1
#define FE_C2	0x02		// FighterE Color 2



/*******************************************************\
 *		ME218_Graphic_Sprite.h							
 *		7 Feb 11										
 *      
 *                Three objects
 *    3x3 FighterA
 *    2x2 FighterB
 *    1x2 FighterC
 *							
 \*******************************************************/

// Example: FighterA has 8 frames 8=TT_SPRITE_DETAIL_cnt
// Example: FighterB has 4 frames

struct live_SPRITE_struct {
	int					ls_index;
	int					ls_total_cnt;
	//	prog_uchar *		ls_raw_data;
	
	//	long				ls_starting_delay;
	long				ls_delay;		// we don't want to overflow with
	// a delay greater than 65k
	
	long				ls_speed_numerator;
	long				ls_speed_denominator;
	
	int					ls_horizontal_size;
	int					ls_vertical_size;
	
	int					ls_current_x;
	int					ls_current_y;
	
	int					ls_visible;
	int					ls_rotation;
	
};


struct SINGLE_SPRITE_ARRAY  {
	prog_uint16_t_XXX					*GRAPHIC_SPRITE_raw_data;
	prog_uint16_t_XXX					starting_SPRITE_delay;
};



struct ALL_GRAPHIC_SPRITE_ARRAY {
	prog_uint16_t_XXX					*init_TIPTOP_SPRITE_frames_array;
	prog_uint16_t_XXX					init_TIPTOP_SPRITE_num_stages;
	
	prog_uint16_t_XXX					init_TIPTOP_SPRITE_vertical_size;	
	prog_uint16_t_XXX					init_TIPTOP_SPRITE_horizontal_size;
	
	prog_uint16_t_XXX					init_TIPTOP_SPRITE_starting_y;
	prog_uint16_t_XXX					init_TIPTOP_SPRITE_starting_x;
	
	
	prog_uint16_t_XXX					init_TIPTOP_SPRITE_rotation;
	prog_uint16_t_XXX					init_TIPTOP_SPRITE_visible;
	
};




static struct			live_SPRITE_struct SpriteTable[TIP_TOP_TOTAL];

static unsigned int		live_SPRITE;			// we parse the sprite tables using this variable

static prog_uint16_t_XXX		*SUPER_MAGIC_SPRITE_VARIABLE;	// FIXME!!!
static	prog_uint16_t_XXX		*SUPER_MAGIC_CITYWALL_VARIABLE;	// FIXME!!!

static int					sprite_smile;


void initializeSPRITEs(void);



#endif // sprite header file
 





